package facepp

import "strings"

func GeneratorParams(params map[string]string) string {
	length := len(params)
	if length == 0 {
		return ""
	}
	var paramStr strings.Builder
	index := 0
	for item := range params {
		if index == 0 {
			paramStr.WriteString("?")
		} else {
			paramStr.WriteString("&")
		}
		paramStr.WriteString(item)
		paramStr.WriteString("=")
		paramStr.WriteString(params[item])
		index++
	}
	return paramStr.String()
}
